package com.gh.scheduled;

import com.gh.constant.MqConst;
import com.gh.service.RabbitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author Eric
 * @Date 2021/6/30 20:44
 * @Version 1.0
 */
@Component
@EnableScheduling
public class ScheduledTask {
    @Autowired
    private RabbitService rabbitService;

    //每天八点提醒就诊
    @Scheduled(cron = "0/30 * * * * ?")
    public void task(){
        //调用rabbitMQ
        rabbitService.sendMessage(MqConst.EXCHANGE_DIRECT_TASK,MqConst.ROUTING_TASK_8,"");
    }
}
